package cn.com.blackboard.DataModule4B2.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.blackboard.DataModule4B2.dao.CreditResultMapper;
import cn.com.blackboard.DataModule4B2.model.CreditResult;
import cn.com.blackboard.DataModule4B2.service.CreditService;

@Service("CreditService")
public class CreditServiceImpl implements CreditService{

	private static final Logger logger = LoggerFactory.getLogger(CreditServiceImpl.class);
	@Autowired
	private CreditResultMapper creditResultMapper;
	
	@Override
	public boolean importCredit(List<CreditResult> CreditResultLst) {
		int count = 0;
		int size = CreditResultLst.size();
		for(CreditResult cr:CreditResultLst){
			int tmp = creditResultMapper.insert(cr);
			count+=tmp;
		}
		if(size == 0)
			return true;
		else if(count/size==1)
			return true;
		else
			return false;
	}


	@Override
	public int insert(CreditResult creditResult) {
		// TODO Auto-generated method stub
		return 0;
	}


	@Override
	public List<CreditResult> getCreditResult() {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public List<CreditResult> getCreditResult(String condition) {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public int updateStatus(String pk1) {
		// TODO Auto-generated method stub
		return 0;
	}


}
